package com.mine.vioceplaylib.voice;

import android.text.TextUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 将播报的语音进行合成
 */
public class VoiceTextTemplate {

    public static List<String> genVoiceList(VoiceBuilder voiceBean) {
        List<String> result = new ArrayList<>();
        String please = voiceBean.getPlease();
        List<String> prefixNum = voiceBean.getPrefixNum();
        String numStr = voiceBean.getNumStr();
        String toStr = voiceBean.getToStr();
        String subfixNum = voiceBean.getSubfixNum();
        String last = voiceBean.getLast();

        if (TextUtils.isEmpty(subfixNum)) {
            return result;
        }


        if (!TextUtils.isEmpty(please)) {
            result.add(please);
        }

        if (prefixNum != null && !prefixNum.isEmpty()) {
            result.addAll(prefixNum);
        }

        if (!TextUtils.isEmpty(numStr)) {
            result.add(numStr);
        }

        if (!TextUtils.isEmpty(toStr)) {
            result.add(toStr);
        }

        if (!TextUtils.isEmpty(subfixNum)) {
            result.add(subfixNum);
        }

        if (!TextUtils.isEmpty(last)) {
            result.add(last);
        }

        return result;
    }


}
